Add JSON Schema Definition for gen_ai.tool.definitions#3378
Add JSON Schema Definition for gen_ai.tool.definitions#3378Cirilla-zmh wants to merge 11 commits intoopen-telemetry:mainfrom
Conversation
Change-Id: Ib6133b3019195e4fa9a54d329ff4b891a281d208 Co-developed-by: Cursor <noreply@cursor.com>
|
I apologize that the previous PR (#2942) was closed due to an incorrect rebase. All comments from the original PR have been addressed, and I believe this PR is now ready to be merged. Here is the change that I have made: 6838193 |
KalleOlaviNiemitalo
left a comment
There was a problem hiding this comment.
These are just my observations. I am not requesting any change.
|
A few thoughts: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4142/changes -- this shows how the GCP GenAi instrumentation records tool definitions currently... Seems we always have a Should we just put tool definitions behind the content capture flag ( Should we have a schema specific to the |
Actually, we've already done that.
I believe we should follow the content capture flag, but the behaviors will be somewhat different with chat messages. Please see the description of That's to say, instrumentations should always capture
Of course! This is an initial PR, and I want to keep the scope limited. I'd rather not include additional definitions like Built-in or MCP Tools yet; we can follow up on those in a separate issue. |
|
Ok mostly SGTM..
Do we want to explicitly recommend instrumentations reuse the content capture flag for this purpose ? The language you have now doesn't really do that.. Also do we want a optional response type on the |
For the implementation, I believe we should reuse the content capture flag. Do you think we should add more relevant details to this description? semantic-conventions/docs/gen-ai/gen-ai-spans.md Lines 691 to 709 in d562045
Good point. @lmolkova and I have discussed this before and we decided to ignore this field for now, considering that most providers other than Gemini do not offer this definition. See #2942 (comment) |
|
This PR has been labeled as stale due to lack of activity. It will be automatically closed if there is no further activity over the next 7 days. |
|
@DylanRussell @aabmass @wikaaaaa |
aabmass
left a comment
There was a problem hiding this comment.
LGTM, @DylanRussell can you take one more look?
|
LGTM too |
There was a problem hiding this comment.
Pull request overview
Adds a dedicated JSON Schema for the gen_ai.tool.definitions attribute and updates the GenAI semantic convention documentation to reference and exemplify the schema across provider pages and non-normative materials.
Changes:
- Introduces
docs/gen-ai/gen-ai-tool-definitions.jsonJSON schema forgen_ai.tool.definitions. - Updates the GenAI registry model and multiple docs pages to require the schema and clarify span vs event recording formats.
- Expands non-normative examples/models to include
gen_ai.tool.definitionsand demonstrate “simplified” recording when content capture is disabled.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| model/gen-ai/registry.yaml | Updates the normative registry entry for gen_ai.tool.definitions to reference the new JSON schema and recording requirements. |
| docs/registry/attributes/gen-ai.md | Updates the attribute registry documentation to reference the new JSON schema and recording requirements. |
| docs/gen-ai/openai.md | Updates OpenAI-specific documentation to reference the new tool definitions schema. |
| docs/gen-ai/anthropic.md | Updates Anthropic-specific documentation to reference the new tool definitions schema. |
| docs/gen-ai/aws-bedrock.md | Updates AWS Bedrock-specific documentation to reference the new tool definitions schema. |
| docs/gen-ai/azure-ai-inference.md | Updates Azure AI Inference-specific documentation to reference the new tool definitions schema. |
| docs/gen-ai/gen-ai-spans.md | Updates span documentation for gen_ai.tool.definitions to reference the new schema and recording requirements. |
| docs/gen-ai/gen-ai-events.md | Updates event documentation for gen_ai.tool.definitions to reference the new schema and recording requirements. |
| docs/gen-ai/gen-ai-agent-spans.md | Updates agent span documentation for gen_ai.tool.definitions to reference the new schema and recording requirements. |
| docs/gen-ai/non-normative/models.ipynb | Adds non-normative Pydantic models and schema-generation snippet for gen_ai.tool.definitions. |
| docs/gen-ai/non-normative/examples-llm-calls.md | Adds gen_ai.tool.definitions to examples, including simplified recording when content capture is disabled. |
| docs/gen-ai/gen-ai-tool-definitions.json | New JSON schema artifact for tool definitions. |
| .chloggen/schema_of_gen_ai_tool_definitions.yaml | Adds a changelog entry describing the enhancement. |
|
thanks @Cirilla-zmh! I've posted a prototype for this at trask/genai-otel-conformance#146 |
Change-Id: I58e6a03cfade2e21142bd19b7ccdcbc17530c308 Co-developed-by: Cursor <noreply@cursor.com>
Change-Id: I2d2a610a1daa38e12c3e7e996ad0a5ad9e82c63b Co-developed-by: Cursor <noreply@cursor.com>
Fixes #2721 #1835
Changes
This PR is a continuation of #2942 #2793. My apologies for accidentally closing the previous one.
Add JSON schema definition for gen_ai.tool.definitions.
Important
Pull requests acceptance are subject to the triage process as described in Issue and PR Triage Management.
PRs that do not follow the guidance above, may be automatically rejected and closed.
Merge requirement checklist
[chore]